package com.android.bonn.fast.net.converter;

import java.io.IOException;

import okhttp3.ResponseBody;
import retrofit2.Converter;

/**
 * User: HuangYunLin(283857754@qq.com)
 * Date: 2016-08-19
 * Time: 17:50
 * FIXME
 */
public class StringResponseConverter<T extends String> implements Converter<ResponseBody, String> {

    StringResponseConverter() {
    }

    @Override
    public String convert(ResponseBody value) throws IOException {

        try {
            return value.string();
        } finally {
            value.close();
        }
    }
}